<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ page import="com.yym.sina.weibo.OAuthTokenGenerator"%>
<%			
	String weiboOAuthUrl = OAuthTokenGenerator.constructAuthorizeUrl();
%>

<script>
			$(document).ready(function() {				

				//connect to sign in dialog event
				$('#dialog-modal')[0].style.display = "none";				
				$('#signinButton').click(function () {
					$( "#dialog:ui-dialog" ).dialog( "destroy" );
					
					$( "#dialog-modal" ).dialog({
						height: 440,
						width: 600,
						modal: true
					});
				});
				
				//connect to weibo oauth event
				$('#weiboSignin').click(function () {
					window.location = "<%=weiboOAuthUrl%>";
				});
				
				//connect to read it later sign in event
				$('#readitlaterSignin').click(function () {
					//show user and password div
					$('#signInFormDiv')[0].style.display = "block";
					$('#signInType')[0].value = "readitlater";					
				});
				
				//connect to sign in button event
				/*$('signInButton').click(function () {
					if($('#signInType')[0].value == "readitlater")
					{
						
					}
				});*/
				
			});
		</script>


<!-- Sign in dialog -->
		<div id="dialog-modal" title="系统登录">
			<p>本站目前支持用以下帐号登录:</p>			
			<p id="weiboSignin" style="width: 126px;height: 24px;background-image: url(<%=resourceBase%>images/widget_connect.gif);"></p>
			<p id="readitlaterSignin" style="width: 157px;height: 24px;background-image: url(<%=resourceBase%>images/readitlater.jpg);"></p>
			<div id="signInFormDiv" style="display:none">
				<form class="signin" id="signInForm" action="<%=path%>/account/authenticate" method="post">
					<p>
						<label for="name">用户名:</label>
						<input id="name" name="name" type="text"></input>						
					</p>
					<div>
						<label for="password">密码:</label>
						<input id="password" name="password" type="password"></input>
					</div>
					<div class="form_submit">
						<input type="hidden" id="signInType" name="signInType"/>
						<input id="signInButton" type="submit" value="登录"></input>
					</div>					
				</form>
			</div>
		</div>
<!-- Sign in dialog End -->